From adcaf192a17100e01f1db68d023d5ab838dc6829 Mon Sep 17 00:00:00 2001 From: Raimond Spekking Date: Wed, 17 Dec 2008 13:54:32 +0000 Subject: [PATCH] Fix hardcoded "last month" in statistic message for acitve users. This is wrong because the number of active users is count in SiteStats::cacheUpdate from recentchanges table. Default of $wgRCMaxAge is 7 days not 30 days. --- includes/specials/SpecialStatistics.php | 10 ++++++---- languages/messages/MessagesEn.php | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/includes/specials/SpecialStatistics.php b/includes/specials/SpecialStatistics.php index 93edcd114d..1c8a0141af 100644 --- a/includes/specials/SpecialStatistics.php +++ b/includes/specials/SpecialStatistics.php @@ -93,12 +93,13 @@ class SpecialStatistics extends SpecialPage { * @param float $number a number * @param array $trExtraParams * @param string $descMsg + * @param string $descMsgParam * @return string table row in HTML format */ - private function formatRow( $text, $number, $trExtraParams = array(), $descMsg = '' ) { + private function formatRow( $text, $number, $trExtraParams = array(), $descMsg = '', $descMsgParam = '' ) { global $wgStylePath; if( $descMsg ) { - $descriptionText = wfMsg( $descMsg ); + $descriptionText = wfMsgExt( $descMsg, array( 'parseinline' ), $descMsgParam ); if ( !wfEmptyMsg( $descMsg, $descriptionText ) ) { $descriptionText = " ($descriptionText)"; $text .= "
" . Xml::element( 'small', array( 'class' => 'mw-statistic-desc'), @@ -148,7 +149,7 @@ class SpecialStatistics extends SpecialPage { array( 'class' => 'mw-statistics-jobqueue' ) ); } private function getUserStats() { - global $wgLang; + global $wgLang, $wgRCMaxAge; return Xml::openElement( 'tr' ) . Xml::tags( 'th', array( 'colspan' => '2' ), wfMsg( 'statistics-header-users' ) ) . Xml::closeElement( 'tr' ) . @@ -158,7 +159,8 @@ class SpecialStatistics extends SpecialPage { $this->formatRow( wfMsgExt( 'statistics-users-active', array( 'parseinline' ) ), $wgLang->formatNum( $this->activeUsers ), array( 'class' => 'mw-statistics-users-active' ), - 'statistics-users-active-desc' ); + 'statistics-users-active-desc', + $wgLang->formatNum( ceil( $wgRCMaxAge / ( 3600 * 24 ) ) ) ); } private function getGroupStats() { global $wgGroupPermissions, $wgImplicitGroups, $wgLang, $wgUser; diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index f6f78bf3db..8a293b0efb 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -2028,7 +2028,7 @@ Remember to check for other links to the templates before deleting them.', 'statistics-jobqueue' => '[http://www.mediawiki.org/wiki/Manual:Job_queue Job queue] length', 'statistics-users' => 'Registered [[Special:ListUsers|users]]', 'statistics-users-active' => 'Active users', -'statistics-users-active-desc' => 'Users who have performed an action in the past month', +'statistics-users-active-desc' => 'Users who have performed an action in the last {{PLURAL:$1|day|$1 days}}', 'statistics-mostpopular' => 'Most viewed pages', 'statistics-footer' => '', # do not translate or duplicate this message to other languages -- 2.20.1